VERSION 0.6
FROM ruby:2.7.1
WORKDIR /ruby-example

deps:
    COPY Gemfile Gemfile.lock ./
    RUN  bundle install
    SAVE ARTIFACT Gemfile.lock AS LOCAL ./Gemfile.lock

build:
    FROM +deps
    COPY src src
    SAVE ARTIFACT src /src

docker:
    FROM +deps
    COPY +build/src src
    ENTRYPOINT ["ruby", "./src/hello.rb"]
    SAVE IMAGE --push earthly/examples:ruby
